package me.bcloud.web.servlet.manager;

import java.io.IOException;
import java.io.OutputStream;

import javax.annotation.Resource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import me.bcloud.web.service.JobConfigService;
import org.springframework.stereotype.Controller;

@Controller
public class DeleteServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	@Resource
	private JobConfigService jobConfigService;

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		resp.setContentType("text/html");
		OutputStream out=resp.getOutputStream();
		if (jobConfigService.del(Integer.parseInt(req.getParameter("id")))) {
			out.write("yes".getBytes());
		}else {
			out.write("no".getBytes());  
		}

	}
}
